﻿var page = {

    /* 此方法在第一次显示窗体前发生 */
    onLoad: function (event) {
        this.wifiInfo = event;
        this.setData({ Tips: "请输入\"" + this.wifiInfo.ssid + "\"的密码" })
        console.dir(this.wifiInfo)
    },

    /* 此方法展示窗体后发生 */
    onResume: function (event) {

    },

    /* 当前页状态变化为显示时触发 */
    onShow: function (event) {

    },

    /* 当前页状态变化为隐藏时触发 */
    onHide: function (event) {

    },

    /* 此方法关闭窗体前发生 */
    onExit: function (event) {

    },

    onTextbox: function (event) {
        this.wifiInfo.psd = event.detail.value;
    },

    onBtn: function (event) {
        if (event.target.id == "connect") {
            var obj = new Object();
            obj.page = "wifiConnectPage";
            obj.ssid = this.wifiInfo.ssid;
            obj.bssid = this.wifiInfo.bssid;
            obj.psd = this.wifiInfo.psd;
            pm.navigateBack({ value: obj });
        } else if (event.target.id == "cancel") {
            pm.navigateBack({ value: "wifiConnectPage" });
        }
    }
};

Page(page);

page = 0;
